<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
	<title>Catalog</title>
</head>
<body>
<body background="img/bg.jpg"> 
	<font face="Berlin Sans FB Demi" color="#357EC7" size="3">
<?
error_reporting (E_ALL ^ E_NOTICE);
include('auth.php');
include('config.php');
$link = mysql_connect(DB_HOST, DB_USER, DB_PASSWORD);
if(!$link) {die('Failed to connect to server: ' . mysql_error());}
           
$db = mysql_select_db(DB_DATABASE);
if(!$db) {die("Unable to select database");}
?>
<b>

<center>
<h1>Schimbare parola</h1>
<table border="1">
<form action="chpass.php" method="post">
<tr><td>Parola curenta:
</td><td><input type="password" name="passcur">
</tr></td><tr><td>
Parola noua:
</td><td><input type="password" name="passnew">
</tr></td><tr><td>
Confirma parola noua:
</td><td><input type="password" name="passconf">
</tr></td><tr><td colspan="2">
<center><input type="submit" value="Schimba parola"></center>
</tr></td>
</table>
</form>
<?
$cpass=$_POST['passcur'];
$npass=$_POST['passnew'];
$npass2=$_POST['passconf'];
if ($cpass!='' and $npass!='' and $npass2!='' and $npass==$npass2) {
$sql=mysql_query("UPDATE elev SET parola='".md5($npass)."' where id='".$_SESSION['SESS_MEMBER_ID']."'");
header('location: index.php');
}
?>
</font>

</body>
</html>